import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [{
    path: '/home',
    name: 'home',
    component: () => import('../views/Home.vue'),
    children: [{
        // 商品
        path: "shop",
        name: 'shop',
        component: () => import('../components/goods/Shop.vue')
      },
      // 评价
      {
        path: "evaluate",
        name: 'evaluate',
        component: () => import('../components/goods/evaluate.vue')
      },
      // 商家
      {
        path: "merchant",
        name: 'merchant',
        component: () => import('../components/goods/merchant.vue')
      },
    ]
  },
  // 详情
  {
    path: "/details",
    name: 'details',
    component: () => import('../views/Details.vue')
  },
  {
    path: '/',
    redirect: "/home/shop"
  }
]

const router = new VueRouter({
  routes
})

export default router